Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate from webpack-rails to external_asset_pipeline #2

Merged
merged 13 commits into from
Oct 5, 2019

Conversation

rmacklin
Copy link
Owner

@rmacklin rmacklin commented Oct 5, 2019

This PR serves as an example of how to migrate an application from the webpack-rails gem (which is no longer maintained) to the external_asset_pipeline gem.

For the most part, the webpack configuration file can be left alone; the only change is switching plugins from stats-webpack-plugin to webpack-assets-manifest.

This avoids having two `application.js` files (one in `webpack/` and one
in `app/assets`, which is confusing/error-prone) in favor of using
unique/unambiguous filenames.
This will be used to produce an asset manifest mapping entry point names
to hashed filenames, for use with the external_asset_pipeline gem. (The
current asset manifest produced by the StatsPlugin is in a different
format that includes a bunch of extra information which isn't needed by
and isn't compatible with external_asset_pipeline.)
This will be used to replace webpack-rails, which is no longer
maintained.
instead of webpack-rails (as the latter is no longer maintained, so
we're replacing it with the former).
These were outdated after we switched from webpack-rails to the
external_asset_pipeline gem.
This was only needed for webpack-rails, which we've stopped using in
favor of the external_asset_pipeline gem (which uses the manifest
produced by the webpack-assets-manifest plugin).
Both webpack-assets-manifest and external_asset_pipeline assume a
default manifest filename of `manifest.json`. The only reason we weren't
using this default before was because we had been using the StatsPlugin
to produce a different `manifest.json` file. Now that we've removed the
StatsPlugin, we can rely on the default webpack-assets-manifest and
external_asset_pipeline configuration.
We stopped using webpack-rails, but we still want these entries in the
gitignore, so we just made the comment more general.
We've replaced this gem (which is no longer maintained) with the
external_asset_pipeline gem
@rmacklin rmacklin merged commit 0ece932 into master Oct 5, 2019
@rmacklin rmacklin deleted the switch-to-external-asset-pipeline branch October 5, 2019 21:47
@rmacklin rmacklin changed the title Switch from webpack-rails to external_asset_pipeline Migrate from webpack-rails to external_asset_pipeline Oct 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant